package com.boarsoft.boar.sys.entity;

import java.util.ArrayList;
import java.util.List;

import com.boarsoft.bean.User;
import com.boarsoft.boar.common.Logon;

@SuppressWarnings("serial")
public class SysUser extends User implements java.io.Serializable {
	/** 个人账号 */
	public static final short TYPE_TRIAL = 0;
	/** 员工账号 */
	public static final short TYPE_NORMAL = 1;
	/** 超级管理员 */
	public static final short TYPE_ADMIN = 2;
	//
	private String corpId; // 所属公司
	private String deptId; // 所属部门
	private short type = TYPE_TRIAL;//
	private String memo;//
	private List<SysRole> roles = new ArrayList<SysRole>();

	public Logon toLogon() {
		Logon lg = new Logon();
		lg.setCorpId(corpId);
		lg.setDeptId(deptId);
		lg.setEmail(email);
		lg.setId(id);
		lg.setCode(nick);
		lg.setName(name);
		return lg;
	}

	public short getType() {
		return type;
	}

	public void setType(short type) {
		this.type = type;
	}

	public String getMemo() {
		return memo;
	}

	public void setMemo(String memo) {
		this.memo = memo;
	}

	public String getCorpId() {
		return corpId;
	}

	public void setCorpId(String corpId) {
		this.corpId = corpId;
	}

	public String getDeptId() {
		return deptId;
	}

	public void setDeptId(String deptId) {
		this.deptId = deptId;
	}

	public SysUser() {
	}

	public List<SysRole> getRoles() {
		return roles;
	}

	public void setRoles(List<SysRole> roles) {
		this.roles = roles;
	}
}